package com.dstation.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dstation.domain.TagInfo;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface TagInfoMapper {

    Long selectTagNameRepeat(@Param("name") String tagName);

    int insertTag(@Param("tagInfo") TagInfo tagInfo, @Param("time")Timestamp time);

    int updateTag(@Param("tagInfo")TagInfo tagInfo);

    int deleteTag(@Param("tagId") long tagId);

    List<TagInfo> selectAllTagInfo();

    TagInfo selectTagInfoByTagName(@Param("tagName") String tagName);

    IPage<TagInfo> selectShowTag(@Param("search")String search,@Param("page") Page page);

    IPage<TagInfo> selectTagsByName(@Param("name") String name,@Param("page") Page page);

    Long selectTagIdByName(@Param("name")String oldName);

    List<TagInfo> selectTagsByVideoId(@Param("videoId") int videoId);
}